/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package cn.edu.zut.jdbcpool.util;

import java.util.Date;
import java.text.SimpleDateFormat;

/**
 *
 * @author jyc
 */
public class DateUtils {
    
    public static String formatNow(String pattern) {
        SimpleDateFormat sdf = new SimpleDateFormat(pattern);
        return sdf.format(getNow());
    }
    
    public static Date getNow() {
        long timeMills = System.currentTimeMillis();
        return new Date(timeMills);
    }
}
